package com.itheima.mall.api.sms;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itheima.mall.mapper.sms.CouponProductRelationMapper;
import com.itheima.mall.pojo.sms.CouponProductRelation;
import com.itheima.mall.pojo.sms.SmsCouponProductRelation;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class CouponProductRelationApiImpl implements CouponProductRelationApi{
    @Autowired
    private CouponProductRelationMapper couponProductRelationMapper;
    @Override
    public List<SmsCouponProductRelation> selectCoupon(Long id) {
        LambdaQueryWrapper<SmsCouponProductRelation>wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(id !=null,SmsCouponProductRelation::getCouponId,id);
        List<SmsCouponProductRelation> couponProductRelations = couponProductRelationMapper.selectList(wrapper);
        return couponProductRelations;
    }
}
